* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.controls-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    height: fit-content;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.control-section {
    margin-bottom: 30px;
}

.control-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.material-categories .category-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.material-categories .category-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
}

.category-item label {
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.category-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #3498db;
}

.material-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 25px;
}

.material-list span {
    font-size: 0.9rem;
    color: #7f8c8d;
    padding: 5px 10px;
    background: #ffffff;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.light-controls, .material-properties {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.control-item input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    transition: all 0.3s ease;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.control-item input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-item input[type="checkbox"] {
    transform: scale(1.3);
    accent-color: #3498db;
}

.value {
    color: #3498db;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.view-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-x: hidden;
}

.view-controls button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.view-controls button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.viewport {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    min-height: 600px;
}

#three-canvas {
    width: 100%;
    height: 600px;
    display: block;
    border-radius: 15px;
}

.material-info {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-panel h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

#material-details {
    font-size: 0.9rem;
    line-height: 1.5;
}

#material-details p {
    color: #7f8c8d;
    margin-bottom: 8px;
}

#material-details strong {
    color: #2c3e50;
}

.comparison-table {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow-x: hidden;
}

.comparison-table h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

.comparison-table tr:hover {
    background: #e3f2fd;
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .controls-panel {
        order: 2;
    }
    
    .viewport {
        order: 1;
    }
    
    .material-info {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .comparison-table {
        padding: 20px;
    }
    
    .comparison-table table {
        font-size: 0.85rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* 材质信息内容样式 */
.material-info-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.material-info-content p {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #34495e;
}

/* 属性详解样式 */
.property-details {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.property-details h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.property-details h4:before {
    content: '⚙️';
    margin-right: 8px;
    font-size: 0.9rem;
}

.property-details p {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.05);
    border-left: 3px solid #3498db;
    border-radius: 0 5px 5px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.property-details p strong {
    color: #2980b9;
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

.property-details p:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(2px);
    transition: all 0.2s ease;
}